<div class="popup_body">
    <div class="ui_table">
        <form method="post">
            <input type="hidden" name="agentId" value="${Session['SESSION_KEY_USER'].agentId}">
            <input type="hidden" name="imagePath" id="image_path_${pid}">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td width="70" align="right">分类名称：</td>
                    <td><input type="text" name="categoryName"maxlength="20" class="text easyui-validatebox" required="true" /></td>
                    <td align="right">序号：</td>
                    <td><input class="text easyui-numberspinner" name="orderNum" required="true" data-options="min:0" style="width: 184px; height: 28px;"/></td>
                </tr>
                <tr>
                    <td align="right">备注：</td>
                    <td><input type="text" maxlength="40"name="memo" class="text easyui-validatebox" /></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </form>
    </div>
</div>
<div class="popup_btn">
    <button class="btn btn_red ok">确定</button>
    <button class="btn btn_border close">关闭</button>
</div>
<script>
    function upload_image_callback(param) {
        $('#image_${pid}').attr('src', '${controller.appConfig.staticUrl}' + param.filePath);
        $('#image_path_${pid}').val(param.filePath);
        $('#' + param.pid).window('close');
    }
    (function() {
        var pid = '${pid}',
                win = $('#' + pid),
                form = win.find('form');

        win.find('button.ok').click(function() {
            form.form('submit', {
                url: '${contextPath}/security/hdw/item_category/create.htm',
                success: function(text) {
                    var json = $.evalJSON(text);
                    <@app.json_jump/>
                    if(json.success) {
                        $.messager.alert('提示信息', '操作成功', 'info');
                        win.window('close');
                    } else {
                        $.messager.alert('提示信息', json.message, 'info');
                    }
                }
            });
        });
        win.find('button.close').click(function() {
            win.window('close');
        });
        win.find('.portrait').click(function() {
            App.dialog.show({
                css: 'width:558px;height:150px;overflow:visible;',
                title: '上传图片',
                href: "${contextPath}/security/hdw/item_category/image.htm",
                event: {
                    onClose: function() {
                    }
                }
            });
        });

    })()
</script>